<template>
  <div class="app">
    <h2>我是祖组件</h2>   
    <Suspense>
      <template v-slot:default>
        <Child></Child>
      </template>
      <template v-slot:fallback>
        <h3>加载中...</h3>
      </template>
    </Suspense>
  </div>
</template>

<script>
// import Child from './components/child.vue'
import {defineAsyncComponent} from 'vue' 
const Child = defineAsyncComponent(() => import('./components/child.vue'))
export default {
  name: 'App',
  components: {
    Child
  },

}
</script>

<style>
.app{
  background-color: aqua;
  padding: 10px;
}
</style>
